<?php
/**渗透测试工单添加mod**/
include "../sql_mod/sql_config.php";

#委托单位信息
$db_project_name = $_POST["project_name"]; //项目名称
$db_client_name = $_POST["client_name"]; //客户公司名称
$db_client_phone_name = $_POST["client_phone_name"]; //客户单位联系人姓名
$db_client_phone = $_POST["client_phone"]; //客户单位联系人电话
$db_client_address = $_POST["client_address"]; //客户单位地址

#渗透对象概要
$db_penetration_patterm = $_POST["penetration_patterm"]; //渗透测试模式
$db_penetration_grade = $_POST["penetration_grade"]; //渗透等级
$db_target_InternetPosition = $_POST["target_InternetPosition"]; //渗透对象网络位置
$db_target_SoftwareArchitecture = $_POST["target_SoftwareArchitecture"]; //渗透对象开发模式
$db_target_scope = $_POST["target_scope"];//渗透测试目标
$db_target_information = $_POST["target_information"]; //渗透测试目标

#渗透任务要求
$db_penetration_position = $_POST["penetration_position"]; //是否现场渗透
$db_penetration_time_out = $_POST["penetration_time_out"]; //渗透测试时间段开始
$db_penetration_time_in = $_POST["penetration_time_in"]; //渗透测试时间段结束
$db_penetration_ExpectedTime = $_POST["penetration_ExpectedTime"]; //望期完成时限
if (count($_POST["exceptional_case"]) != 0){                 //非必选项判断
    $db_exceptional_case = $_POST["exceptional_case"]; //特殊情况备注
}else{
    $db_exceptional_case = "";
}

#时间
$db_post_time = date("Y年m月d日 H:i:s"); //渗透测试工单提交时间

#编号
$time = date("y");
$db_project_id_zzjc = "ZZJC/05 XX-$time";//渗透测试编号

#FLAG
$db_flag = "正在审核";//渗透测试阶段

#派单人
$db_dispatch_name = "超级管理员(测试)";



$sql = "INSERT INTO `zzhk`.`zzhk_works`(`project_id_zzjc`, `project_name`, `client_name`, `client_phone_name`, `client_phone`
, `client_address`, `dispatch_name`, `update_time`, `post_time`
, `penetration_patterm`, `penetration_grade`, `target_InternetPosition`, `target_SoftwareArchitecture`
, `target_scope`, `target_information`, `penetration_position`, `penetration_time_out`, `penetration_time_in`
, `penetration_ExpectedTime`, `exceptional_case`, `flag`) 
VALUES ('$db_project_id_zzjc', '$db_project_name', '$db_client_name', '$db_client_phone_name', '$db_client_phone'
, '$db_client_address', '$db_dispatch_name', '$db_post_time/*最后修改时间*/', '$db_post_time'
, '$db_penetration_patterm', '$db_penetration_grade', '$db_target_InternetPosition', '$db_target_SoftwareArchitecture'
, '$db_target_scope', '$db_target_information', '$db_penetration_position', '$db_penetration_time_out', '$db_penetration_time_in'
, '$db_penetration_ExpectedTime', '$db_exceptional_case', '$db_flag')";

if (mysqli_query($conn,$sql)){
    echo "<br />添加工单成功！";
}else{
    echo "<br />添加工单失败！数据库写入错误!";
}
mysqli_close($conn);